package com.itheima.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.itheima.api.OmsOrderReturnApi;
import com.itheima.dto.returnReason;
import com.itheima.dto.returnReasonDto;
import com.itheima.pojo.OmsOrderReturnApply;
import com.itheima.vo.MinioVo;
import com.itheima.vo.PageResult;
import org.apache.dubbo.config.annotation.DubboReference;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * @author 芝士雪豹
 * @create 2022/10/15/17:18
 */
@Service
public class OmsOrderReturnService {
    @DubboReference
    private OmsOrderReturnApi api;

    //添加退货原因
    public MinioVo create(returnReasonDto dto) {
        MinioVo vo = api.create(dto);
        return vo;
    }

    //批量删除退货原因
    public MinioVo delete(Integer[] ids) {
        MinioVo vo = api.delete(ids);
        return vo;
    }

    //分页查询退货原因
    public Page<OmsOrderReturnApply> list(String createTime, String handleMan, String handleTime, Integer id, Integer pageNum, Integer pageSize, String receiverKeyword, Integer status) {
        Page<OmsOrderReturnApply> vo = api.list(createTime,handleMan,handleTime,id,pageNum,pageSize,receiverKeyword,status);
        return vo;
    }

    //修改退货原因启用状态
    public MinioVo updateStatus(Integer[] ids, Integer status) {
        MinioVo vo = api.updateStatus(ids, status);
        return vo;
    }

    //修改退货原因
    public MinioVo updateById(Integer id, returnReason dto) {
        MinioVo vo = api.updateById(id, dto);
        return vo;
    }

    //获取单个退货原因详情信息
    public MinioVo findOne(Integer id) {
        MinioVo vo = api.findOne(id);
        return vo;
    }
}
